{% extends "base.html" %}

{% block title %}
    权限列表
{% endblock %}

{% block content %}
    <div class="btn-toolba">
        <div class="btn-group">
            {% url "addpermissonurl" as theaddpermissonurl %}
            <a class="btn btn-default {% if request.path == theaddpermissonurl %}
            active
            {% endif %}"
               href={{ theaddpermissonurl }}><span class="glyphicon glyphicon-edit"></span>新建权限</a>
            {% url "listpermissionurl" as thelistpermissionurl %}
            <a class="btn btn-default {% if request.path == thelistpermissionurl %}
            active
            {% endif %}"
               href={{ thelistpermissionurl }}><span class="glyphicon glyphicon-list"></span>权限列表</a>
        </div>
    </div>

    <hr/>

    <table class="result-tab" width="100%">
        <tr>
            <th>权限名称</th>
            <th>URL</th>
            <th>操作</th>
        </tr>

        {% for i in lpage %}
            <tr style="font-size: 13px;">
                <td>{{ i.name }}</td>
                <td>{{ i.url }}</td>
                <td>
                    <a href={% url "editpermissionurl" i.id %} onclick="return confirm('确认编辑权限吗？？')"><span
                        class="glyphicon glyphicon-edit btn-xs"></span></a>
                    <a href={% url "deletepermissionurl" i.id %} onclick="return confirm('确认删除权限吗？？')"><span
                        class="glyphicon glyphicon-trash btn-xs"></span></a>
                </td>
            </tr>
        {% endfor %}
    </table>
    {% include "paginator.html" %}
{% endblock %}